<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/js/axios.min.js"></script>
<script src="/js/util.js"></script>
<script>
    var orderId = getQuery("orderId");
    alert(orderId)
    axios.get("order/findById",{
        params:{
            orderId
        }
    }).then(e => {
        var info = e.data;
        $('orderId').innerHTML = info.id;
        $('accept').innerHTML = info.accept;
        $('address').innerHTML = info.address;
        $('phone').innerHTML = info.phone;
        $('orderTime').innerHTML = info.orderTime;
        $('orderStatus').innerHTML = info.status;
        $('totalPrice').innerHTML = info.sumPrice;
        var str = "";
        for (var i=0;i<info.list.length;i++){
            var obj = info.list[i];
            str += `<tr><td>${obj.product.id}</td><td>${obj.product.name}</td><td>${obj.product.price}</td><td>${obj.count}</td></tr>`
        }
        $('detailData').innerHTML = str;
    })

</script>
<body>
    <h2>订单详情</h2>
    订单号:<span id="orderId"></span><br>
    收货人:<span id="accept"></span><br>
    收货地址:<span id="address"></span><br>
    收货人电话:<span id="phone"></span><br>
    下单时间:<span id="orderTime"></span><br>
    订单总价:<span id="totalPrice"></span><br>
    订单状态:<span id="orderStatus"></span><br>
    <table width="60%" cellspacing="0" border="1">
        <thead>
            <tr><th>商品编号</th><th>商品名</th><th>单价</th><th>购买数量</th></tr>
        </thead>
        <tbody id="detailData"></tbody>
    </table>
</body>
</html>